package gsw.common.share;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

import gsw.common.R;
import gsw.tool.common.ToolShare;

/**
 * 分享demo
 * 参考链接：https://www.jianshu.com/p/0a0e2258b3d6
 */
public class ActivityShare extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_share);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                int[] resIDS = {R.mipmap.icon_finger, R.mipmap.icon_finger};
                ToolShare.shareText(ActivityShare.this, "这个我分享的内容...", ToolShare.WEIXIN);
            }
        });
    }

    /**
     * 显示snackbar
     *
     * @param view
     */
    public void showSnackbar(View view) {
        Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_INDEFINITE)
                .setAction("Action", new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                    }
                }).show();
    }
}
